home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / m68k / 339 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.1 KB

  1. Path: mail2news.demon.co.uk!caren.demon.co.uk
  2. From: Loris Caren <loris@caren.demon.co.uk>
  3. Newsgroups: comp.arch.embedded,comp.sys.m68k
  4. Subject: Re: Flash programming tool for BDM
  5. Followup-To: comp.arch.embedded,comp.sys.m68k
  6. Date: Tue, 5 Mar 1996 09:23:17 GMT
  7. Organization: Caren Electronic Consultants
  8. Sender: usenet@caren.demon.co.uk
  9. Message-ID: <DnsFEu.Iq@caren.demon.co.uk>
  10. References: <4h1sc2$cq2@sdaw04.seinf.abb.se>
  11. X-NNTP-Posting-Host: caren.demon.co.uk
  12. X-Newsreader: TIN [UNIX 1.3 BETA-950824-color PL0]
  13. X-Mail2News-Path: disperse.demon.co.uk!post.demon.co.uk!caren.demon.co.uk
  14.  
  15. background Debug Module support for Mote 683XX processors
  16.  
  17. This note describes the facilities that I have developed for
  18. connecting my 486PC running Linux to the BDM port of a
  19. 683XX.  Using a P+E ICD32 'dongle' connected to a secondary
  20. parrallel port I can communicate with the target processor
  21. in two different ways:-
  22.  
  23. bdm
  24. bdm is a compiled binary which is based on Tcl (Tool Command
  25. Language).  It extends the standard Tcl command set with
  26. additional commands which allow one to examine or set target
  27. processor registers or memory, tell the processor to run,
  28. etc.  These primative operatives can be used in conjunction
  29. with the standard tcl commands to (for example) download
  30. code into an on-board Flash EPROM.  For more details of Tcl
  31. get ISBN 0-201-63337-X or join comp.lang.tcl newsgroup.
  32. Here are my extensions to tcl:-
  33.  
  34. register addr [value]
  35. peek addr [size]
  36. poke addr value [size]
  37. fill addr count value [size]
  38. stop
  39. go [addr]
  40. step [addr]
  41. reset
  42. dload srec
  43. wait
  44. quit
  45.  
  46. gdb68
  47. The second interface to the bdm port has been made by
  48. creating a version of the gdb symbolic debugger with an
  49. additional target method compiled into it.  This target bdm
  50. allows full symbolic debug and code download via the bdm
  51. port.  Obviously breakpoint insertion are restricted to
  52. areas of target memory that are RAM.  Because 683XX devices
  53. are almost totally configuarable via the SIM registers,
  54. these usually need to be initialised before code can be run,
  55. but it is simple to write gdb macros to do this.
  56.  
  57. The code
  58. The code can be considered as  being organised into 4 layers:-
  59.  
  60. 1/ either the gdb code or TCL command extensions
  61. 2/ command functions such as int getRegister(int n)
  62. 3/ bit shifting and wiggling code specific to the ICD32 dongle
  63. 4/ mio - read/write device driver to control parallel port in a non 
  64. centronics printer manner.
  65.  
  66. Flash PEROM Blowing
  67. I am able to use the tcl based bdm tool described above to download code
  68. to Atmel Flash EPROMS (which I now do not socket). This is accomplished
  69. using tcl script which:-
  70. 1. Interogates the PEROM to determine what flavor it is and how big are
  71. the 'pages' it uses.
  72. 2. Downloads a small blower programme to the target RAM.
  73. 3. Downloads a 'page' of the code to be blown into RAM.
  74. 4. Runs the target blower code which copies the 'page' from RAM to the flash
  75. device (you can't write to the flash directly via the BDM cos it's not fast
  76. enough).
  77. 5. Wait for the blower code to finish and then repeat 3..5 for subsequent
  78. pages.
  79.  
  80. I will gladly post this code to anybody who is interested, but note that you
  81. will have to build a new kernel before it can be run.
  82.